package devbureau.fstore.report;

import devbureau.fstore.common.ItemData;
import devbureau.fstore.common.StoreFactory;
import devbureau.fstore.common.print.report.PrintReminderReport;
import devbureau.fstore.util.PropertyHelper;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class BalanceReport {
    public static void main(String[] args) {
        String filePath = null;
        try{
           PropertyHelper.setPropertyPath("c:/opt/store/conf/report.properties");
           SimpleDateFormat format = new SimpleDateFormat("_yyyyMMdd_HHmm");
           filePath = "c:/opt/store/report/balance"+format.format(new Date())+".xls";
           List<ItemData> reminders = StoreFactory.getStore().getBalanceReport();
           new PrintReminderReport(reminders,new FileOutputStream(filePath)).writeReport();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
}
